New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

logdis-core

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logdis-core

Modular log processing framework - the core module. http://logdis.io/

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

LogDis

LogDis is a logging framework which allows you to do whatever the hell you want. It's kinda like logstash, but easier to configure and use.

Seriously. Just try it.

It has inputs, filters and outputs.

Inputs

Are event emitters.

Filters

Are synchronous. Take data, return data.

Outputs

Are asynchronous. Take data, calls back when complete.

Example

This example will read from StdIn, remove blank lines, convert each line to JSON, scrub the 'username' field, add a timestamp to each line, then write each line to stdout. The program will quit when stdin closes:

// core
var logdis = require('./logdis-core')

// inputs
var fromStdIn  = require('./logdis-input-stdin')()

// filters
var removeBlankLines = require('./logdis-filter-remove-blank-lines')()
var convertToJson = require('./logdis-filter-to-json')()
var scrub = require('./logdis-filter-scrub')({ scrub : { 'username' : true } })
var timestamp = require('./logdis-filter-timestamp')({ fieldname : 'timestamp', format : 'epoch' })

// outputs
var toStdOut = require('./logdis-output-stdout')()

logdis()
  .input(fromStdIn)
  .filter(removeBlankLines)
  .filter(convertToJson)
  .filter(scrub)
  .filter(timestamp)
  .output(toStdOut)

Getting Started

You can use logdis programmatically, or through a configurable command line program.

Command Line

Install the logdis-cli package (which depends on logdis-core). Install any inputs, filters and outputs you'd like to use.

Then just run the command line and point to the config file:

$ logdis config.json

To mimick the above example, config.json would look like:

{
    "error" : "stderr",
    "pipeline" : [
        {
            "type" : "input",
            "plugin" : "stdin"
        },
        {
            "type" : "filter",
            "plugin" : "remove-blank-lines" },
        {
            "type" : "filter",
            "plugin" : "to-json"
        },
        {
            "type" : "filter",
            "plugin" : "scrub",
            "opts" : { scrub : [ 'username' ] }
        },
        {
            "type" : "filter",
            "plugin" : "to-json",
            "opts" : { "fieldname" : "timestamp", "format" : "epoch" },
        {
            "type" : "output",
            "plugin" : "stdout"
        },
    ]
}

Programmatic API

Decide what kinds of inputs, filters and outputs you'd like to use, then install them:

npm install --save logdis-core logdis-input-stdin logdis-filter-timestamp logdis-output-stdout

Then just create a logdis instance, configure and add those same inputs, filters and outputs.

License

ISC.

(Ends)

Keywords

FAQs

Package last updated on 15 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc